# 13 digit ISBN checker t=0 isbn=[9,7,8,1,4,4,4,1,8,2,2,6,2] #This is a 13 digit ISBN for i in range (0, 12,2): t=t+ isbn[i] for i in range (1, 12,2): t=t+isbn[i]*3 remainder = t % 10 calcedCD= (10 -remainder) % 10 if isbn[12] == calcedCD: print("The calculated check digit matches the last digit") else: print("Oh no, they don't match!")